package com.scoressystem.service.impl;

import com.scoressystem.mapper.TeacherMapper;
import com.scoressystem.pojo.Teacher;
import com.scoressystem.service.TeacherService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {

    @Resource
    TeacherMapper teacherMapper;


    @Override
    public List<Teacher> findTeachers() {
        return teacherMapper.findAll();
    }

    @Override
    public Teacher getTeacherById(Integer teacherId) {
        return teacherMapper.findById(teacherId);
    }

    @Override
    public Teacher getTeacherByName(String userName, String password) {
        return teacherMapper.getTeacherByName(userName, password);
    }

    @Override
    public int updatePwd(String name, String newPwd) {
        return teacherMapper.updatePwd(name, newPwd);
    }
}
